import { HttpCode, UseGuards, applyDecorators } from '@nestjs/common';
import { ApiBasicAuth, ApiOperation } from '@nestjs/swagger';
import { TokenAuth } from 'src/common/gaurd/tokenAuth.gaurd';

export function Auth(description: string) {
  return applyDecorators(
    ApiOperation({
      description,
    }),
    HttpCode(200),
    // @Post("/saveMessage")
    ApiBasicAuth('token'),
    UseGuards(TokenAuth)
  );
}